package src.entity;
import java.util.Date;

public class Habit {
    private String name;
    private String content;
    private int continuousDays;
    private int totalDays;
    private Date startDate;

    public Habit(String name, String content, Date startDate) {
        this.name = name;
        this.content = content;
        this.startDate = startDate;
        this.continuousDays = 0;
        this.totalDays = 0;
    }

    // 打卡逻辑
    public void checkIn() {
        this.continuousDays++;
        this.totalDays++;
    }

    // 断签重置连续天数
    public void resetContinuousDays() {
        this.continuousDays = 0;
    }

    // Getter & Setter
    public String getName() { return name; }
    public String getContent() { return content; }
    public int getContinuousDays() { return continuousDays; }
    public int getTotalDays() { return totalDays; }
    public Date getStartDate() { return startDate; }
}